package com.jinzhu.common.httpclient;

import lombok.Data;

@Data
public class ResultError {


    // 消息状态码
    private Integer error;
    // 消息
    private String error_mag;


    private ResultError(Integer error, String error_mag) {

        this.error = error;
        this.error_mag = error_mag;
    }

    /**
     * 响应成功(带返回数据)
     * @param  返回数据
     * @return Result
     */
    public static ResultError success(){
        return new ResultError(0,"响应成功");
    }



    /**
     * 响应错误(不带状态码,带消息)
     * @return Result
     */
    public static ResultError error(String msg){
        return new ResultError(1,msg);
    }




}
